#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPushButton *button = new QPushButton(this);

    connect(button, &QPushButton::clicked, this, &Widget::EmitSignal);
    connect(this, &Widget::MySignal, this, &Widget::HandleMySignal);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::EmitSignal()
{
    emit MySignal();
}

void Widget::HandleMySignal()
{
    qDebug() << "槽函数被执行";
}

